require 'sidekiq/web'
Sidekiq::Web.set :session_secret, Rails.application.secrets[:secret_key_base]

Rails.application.routes.draw do

  resources :operation_logs
  resources :projects do
    member do
      get :do
      patch :do_exec
    end
  end
  root to: 'projects#index'
  get 'sessions/failure'
  get '/logout', to: 'sessions#destroy'
  get '/login', to: 'sessions#login'
  # 登录
  post '/login', :to => 'sessions#create'



  resources :users

  require 'sidekiq/web'
  mount Sidekiq::Web => '/sidekiq'
  mount ExceptionTrack::Engine => "/exceptions"
end

handle = Rails.env.production? ? method(:require) : method(:load)
Dir.glob(File.join(Rails.root, 'config', 'routes', '*.rb'), &handle)